import { validatenull } from '@/utils/validate'

export function packageImgList(img) {
  if (!validatenull(img)) {
    const nameList = []
    const imgList = []
    const list = img.split(',')
    list.forEach(
      item => {
        if (!validatenull(item)) {
          nameList.push(item)
          imgList.push({ name: item, url: item })
        }
      }
    )
    return [nameList, imgList]
  } else {
    return []
  }
}
